#ifndef IPSETDLG_H
#define IPSETDLG_H
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
            TypeName(const TypeName&); \
            void operator=(const TypeName&)

#include <QDialog>
#include <QMessageBox>
#include <QCloseEvent>
#include <QValidator>
#include <QHostAddress>
#include "logger.h"

namespace Ui {
class IPSetDlg;
}

class IPSetDlg : public QDialog
{
    Q_OBJECT

public:
    explicit IPSetDlg(QWidget *parent = nullptr);
    ~IPSetDlg();

    QString getHostAddr();
    unsigned short getPort();

private slots:

    void on_okBtn_clicked();

//    void on_cancelBtn_clicked();

//    void closeEvent(QCloseEvent *event);

private:
    DISALLOW_COPY_AND_ASSIGN(IPSetDlg);
    Ui::IPSetDlg *ui;

    QString hostAddr;
    unsigned short port = 0;
    Logger logger;

signals:
    void IPChanged(QString, unsigned short);
};

#endif // IPSETDLG_H
